<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>用户注册</title>
<%@include file="../core/head.jsp"%>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="登录超时，重新登录">
<link rel="stylesheet" href="${ctx}/css/core.css" type="text/css"></link>
<link rel="stylesheet" href="${ctx}/css/buttons.css" type="text/css"></link>
<link rel="stylesheet" href="${ctx}/css/table.css" type="text/css"></link>
<script type="text/javascript">
function login(){
	
	$.ajax({
		dataType : "json",
		cache : true,
		type : "POST",
		url : "${ctx}/login.jsp",
		data : $("#ajaxLoginForm").serialize(),
		error : function(XMLHttpRequest, textStatus, errorThrown){  
			$(".error").text("服务器连接异常"); 
			alert("readstate:"+XMLHttpRequest.readyState +"\nstatus:"+ XMLHttpRequest.status +"\ntext:"+ XMLHttpRequest.responseText);  
	        alert("textStatus:"+textStatus);
	        alert("errorThrown:"+errorThrown);
	        
		},
		success : function(data) {
			if(!data.error||data.error==""){
				if (parent && parent.$.AjaxAuthFilter.cleckOver) {
					parent.$.AjaxAuthFilter.cleckOver(data);
				}
			}
			$(".error").text(data.error);
		}
	});
}
</script>
</head>
<body>
	<div align="center">
		<form action="/login.jsp" id="ajaxLoginForm" method="post">
			<table class="table">
				<tr>
					<th class="left">用户名：</th>
				</tr>
				<tr>
					<td><input type="text" name="username" /></td>
				</tr>

				<tr>
					<th class="left">密码：</th>
				</tr>
				<tr>
					<td><input type="password" name="password" /></td>
				</tr>
				<tr>
					<td>
						<label style="margin-right: 5px;">
							<input type="checkbox"  name="rememberMe" value="true" checked="checked"/>  
							<span>自动登录</span>
						</label>
						<span class="error" ></span>
					</td>
				</tr>
				<tr>
					<td><input type="button" onclick="login()" class="button green" style="width: 280px;height: 34px ; padding:5px; text-align: center;" value="登录" /></td>
				</tr>
			</table>
			<form>
	</div>
</body>
</html>
